package com.exam.mapper;

import com.exam.po.Announcement;
import com.exam.po.Admin;
import com.exam.po.Student;
import com.exam.po.Teacher;
import com.exam.po.TeacherExample;
import java.util.List;

import com.exam.ustudent.UStudent;
import org.apache.ibatis.annotations.Param;

public interface TeacherMapper {
    int countByExample(TeacherExample example);

    int deleteByExample(TeacherExample example);

    /*
     * @Author mahaoqi
     * @Description 根据主键删除 教师
     * @Date 2021/1/13 10:51
     * @Param [teacherid]
     * @return int
     **/
    int deleteByPrimaryKey(Integer teacherid);

    int insert(Teacher record);

    /*
     * @Author mahaoqi
     * @Description 添加教师
     * @Date 2021/1/13 10:51
     * @Param [record]
     * @return int
     **/
    int insertSelective(Teacher record);

    List<Teacher> selectByExample(TeacherExample example);

    Teacher selectByPrimaryKey(Integer teacherid);

    int updateByExampleSelective(@Param("record") Teacher record, @Param("example") TeacherExample example);

    int updateByExample(@Param("record") Teacher record, @Param("example") TeacherExample example);

    /*
     * @Author mahaoqi
     * @Description 修改教师信息  动态sql
     * @Date 2021/1/13 10:52
     * @Param [record]
     * @return int
     **/
    int updateByPrimaryKeySelective(Teacher record);

    int updateByPrimaryKey(Teacher record);

    List<UStudent> findStudentsByCourse(@Param("teacherId") Integer teacherId, @Param("page") Integer page, @Param("size") Integer size);

    /*
     * @Author mahaoqi
     * @Description 分页查询
     * @Date 2021/1/13 10:52
     * @Param [page, pageSize]
     * @return java.util.List<com.exam.po.Teacher>
     **/
    List<Teacher> selectList(@Param("page") Integer page,@Param("pageSize")Integer pageSize);

    /*
     * @Author mahaoqi
     * @Description 查找总记录数
     * @Date 2021/1/13 10:52
     * @Param []
     * @return int
     **/
    int selectCount();

    /*
     * @Author mahaoqi
     * @Description 教师登录
     * @Date 2021/1/13 10:57
     * @Param [teacherid, pwd]
     * @return com.exam.po.Teacher
     **/
    Teacher findByIdAndPwd(@Param("teacherid") Integer teacherid, @Param("pwd") String pwd);

    List<Announcement> selectAllAnnouncement();
    //查询代课老师对应学生的成绩
    List<UStudent> selectStudentScore(@Param("teacherId") Integer teacherId, @Param("page") Integer page, @Param("size") Integer size);
    //老师查询学生成绩总记录数
    int selectStudentScoreCount(@Param("teacherId") Integer teacherId);
    //查询授课老师对应学生总数
    int findStudentByTeacherCounts(@Param("teacherId") Integer teacherId);



}